/**
 * 
 */
package com.repository.controller;

import junit.framework.TestCase;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.client.RestTemplate;

/**
 * We are using Spring's TestContext support
 * @author lovkeshsingh
 *
 */
public class ControllerTestCases extends TestCase{

	@Autowired
	RestTemplate restTemplate;
	
	Log log = LogFactory.getLog(ControllerTestCases.class);
	
	@RequestMapping("/test/user/delete/{userId}")
	public void userDeleteTest(@PathVariable Long userId){
		if(null != restTemplate){
			log.debug("got restTemplate");
			//restTemplate.put("http://localhost:8080/userrepositoryservice/user/{userId}/{userName}/{password}", new User(), "3", "lovkesh","new");
			restTemplate.delete("http://localhost:8080/userrepositoryservice/user/"+userId);
		}
	}
	
}
